#!/bin/sh

# This script is intended to be sourced by
# susan-database-common postinstall script
# on Debian based distributions.
# It helps to configure dbconfig
# when migrating to dbconfig.

LIB=/usr/lib/susan/scripts/susan-config-lib.sh

if ! [ -r "$LIB" ]; then
    echo "failed to read library $LIB" >&2
else
    . $LIB

    #dbc_dbserver=
    #dbc_dbport=
    dbname=`get_database_name @db_name@`
    dbuser=`get_database_user @db_user@`
    dbpass=`get_database_password`
    case "`get_database_driver`" in
        postgresql)
            dbtype="pgsql"
            ;;
        mysql)
            dbtype="mysql"
            ;;
        sqlite3)
            dbtype="sqlite3"
            basepath="`get_working_dir`"
            ;;
    esac
fi
